/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import com.openbrew.openbrewrf.views.FGIView;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dchapman
 */
@Entity
@Table(name = "ATBeer")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ATBeer.findAll", query = "SELECT a FROM ATBeer a"),
    @NamedQuery(name = "ATBeer.findByATBeerID", query = "SELECT a FROM ATBeer a WHERE a.aTBeerID = :aTBeerID"),
    @NamedQuery(name = "ATBeer.findByATBeerQty", query = "SELECT a FROM ATBeer a WHERE a.aTBeerQty = :aTBeerQty")})
public class ATBeer implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ATBeerID")
    private Integer aTBeerID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ATBeerQty")
    private int aTBeerQty;
    @JoinColumn(name = "FGIID", referencedColumnName = "FGIID")
    @ManyToOne(optional = false)
    private FGIView atFgiID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "servingTankVolume")
    private float servingTankVolume;

    public ATBeer() {
    }

    public ATBeer(Integer aTBeerID) {
        this.aTBeerID = aTBeerID;
    }

    public ATBeer(Integer aTBeerID, int aTBeerQty) {
        this.aTBeerID = aTBeerID;
        this.aTBeerQty = aTBeerQty;
    }

    public Integer getATBeerID() {
        return aTBeerID;
    }

    public void setATBeerID(Integer aTBeerID) {
        this.aTBeerID = aTBeerID;
    }

    public int getATBeerQty() {
        return aTBeerQty;
    }

    public void setATBeerQty(int aTBeerQty) {
        this.aTBeerQty = aTBeerQty;
    }

    public FGIView getAtFgiID() {
        return atFgiID;
    }

    public void setAtFgiID(FGIView atFgiID) {
        this.atFgiID = atFgiID;
    }

    public float getServingTankVolume() {
        return servingTankVolume;
    }

    public void setServingTankVolume(float servingTankVolume) {
        this.servingTankVolume = servingTankVolume;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (aTBeerID != null ? aTBeerID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ATBeer)) {
            return false;
        }
        ATBeer other = (ATBeer) object;
        if ((this.aTBeerID == null && other.aTBeerID != null) || (this.aTBeerID != null && !this.aTBeerID.equals(other.aTBeerID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.ATBeer[ aTBeerID=" + aTBeerID + " ]";
    }
    
}
